<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>业务模块-活动订单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="${s.base}/css/base/base.css" media="all" /></head>
<style type="text/css">
    .layui-table tbody .layui-table-cell {
        height: auto;
        line-height: 88px;
    }
</style>
<body class="childrenBody">
<form class="layui-form" action="/webOrder/export?signId=${signId}" method="post">
    <blockquote class="layui-elem-quote quoteBox" id="tool">
        <div class="layui-inline">
            <label class="layui-input-inline">姓名</label>
            <label class="layui-input-inline">
                <input type="text" class="layui-input" name="name" placeholder="请输入姓名" /></label>
            <label class="layui-input-inline">性别</label>
            <label class="layui-input-inline">
                <select name="sex" id="sex"></select>
            </label>
            <label class="layui-input-inline">联系电话</label>
            <label class="layui-input-inline">
                <input type="text" class="layui-input" name="phone" placeholder="请输入联系电话" /></label>
            <#if webSignUp.userType=='2'>
                <label class="layui-input-inline">学生年级</label>
                <label class="layui-input-inline">
                    <select name="studentGrade" id="studentGrade"></select>
                </label>
                <label class="layui-input-inline">就读学校</label>
                <label class="layui-input-inline">
                    <select name="studentSchool" id="studentSchool"></select>
                </label>
                <label class="layui-input-inline">家长姓名</label>
                <label class="layui-input-inline">
                    <input type="text" class="layui-input" name="parentName" placeholder="请输入家长姓名" /></label>
            </#if>

            <label class="layui-input-inline">审核状态</label>
            <label class="layui-input-inline">
                <select name="status" id="status"></select>
            </label>
            <a class="layui-btn search_btn" lay-submit="" lay-filter="seacherBtn">搜索</a></div>
        <div class="layui-inline">
            <a class="layui-btn layui-btn-normal addBtn" data-title="添加" data-url="/webOrder/getEntity">添加</a>
            <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="exportBtn"  type="submit" >导出</button>
        </div>
    </blockquote>
    <table id="entityList" lay-filter="entityList"></table>
</form>
<script type="text/html" id="entityBar">
    <a class="layui-btn cy-btnbg-edit layui-btn-sm" lay-event = "edit" > 编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a >
    <a class="layui-btn cy-btnbg-edit layui-btn-sm" lay-event = "print" >打印</a>
</script>
<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script type="text/javascript">layui.use(['jquery', 'pageUtil', 'table', 'dateUtil', 'fileUtil'],
    function() {
        var $ = layui.jquery,
            dateUtil = layui.dateUtil,
            fileUtil = layui.fileUtil,
            table = layui.table,
            pageUtil = layui.pageUtil;
        var tableIns = null;
        var signId='${signId}';
        var userType='${webSignUp.userType}';//1、成人，2、儿童
        pageUtil.initDict("base_sex,web_grade,web_school,base_check_status,web_user_type",
            function(dictData) {
                pageUtil.showDict($("#sex"), pageUtil.aceeptDictContentList(dictData, "base_sex"), "请选择性别");
                pageUtil.showDict($("#studentGrade"), pageUtil.aceeptDictContentList(dictData, "web_grade"), "请选择学生年级");
                pageUtil.showDict($("#studentSchool"), pageUtil.aceeptDictContentList(dictData, "web_school"), "请选择就读学校");
                pageUtil.showDict($("#status"), pageUtil.aceeptDictContentList(dictData, "base_check_status"), "请选择审核状态");
                var url = "/webOrder/page?signId="+signId;
                var cols="";
                if(userType=="2"){
                    cols = [{
                        type: 'checkbox',
                        fixed: 'left'
                    },
                        {
                            type: 'numbers',
                            title: '序号'
                        },
                        {
                            field: 'name',
                            title: '姓名',
                            align: 'center'
                        },
                        {
                            field: 'userType',
                            title: '用户类型',
                            align: 'center',
                            templet: function(d) {
                                return pageUtil.aceeptDictContentName(dictData, 'web_user_type', d.userType);
                            }
                        },
                        {
                            field: 'headImage',
                            title: '照片',
                            align: 'center',
                            templet: function(d) {
                                return "<img lay-event ='showPicture' src='"+d.headImage+"' style='width:auto; height: 80px;'/>";
                            }
                        },
                        {
                            field: 'brithday',
                            title: '出生日期',
                            align: 'center'
                        },
                        {
                            field: 'sex',
                            title: '性别',
                            align: 'center',
                            templet: function(d) {
                                return pageUtil.aceeptDictContentName(dictData, 'base_sex', d.sex);
                            }
                        },
                        {
                            field: 'nation',
                            title: '民族',
                            align: 'center'
                        },
                        {
                            field: 'studentGrade',
                            title: '年级',
                            align: 'center',
                            templet: function(d) {
                                return pageUtil.aceeptDictContentName(dictData, 'web_grade', d.studentGrade);
                            }
                        },
                        {
                            field: 'phone',
                            title: '联系电话',
                            align: 'center'
                        },
                        {
                            field: 'studentSchool',
                            title: '就读学校',
                            align: 'center',
                            templet: function(d) {
                                return pageUtil.aceeptDictContentName(dictData, 'web_school', d.studentSchool);
                            }
                        },
                        {
                            field: 'parentName',
                            title: '家长姓名',
                            align: 'center'
                        },
                        {
                            field: 'workAddress',
                            title: '工作单位',
                            align: 'center'
                        },
                        {
                            field: 'homeAddress',
                            title: '家庭地址',
                            align: 'center'
                        },
                        {
                            field: 'createTime',
                            title: '报名时间',
                            width: 190,
                            align: 'center',
                            templet: function(d) {
                                return dateUtil.formatDate(new Date(d.createTime), "yyyy-MM-dd hh:mm:ss");
                            }
                        },
                        {
                            field: 'status',
                            title: '审核状态',
                            align: 'center',
                            templet: function(d) {
                                return pageUtil.aceeptDictContentName(dictData, 'base_check_status', d.status);
                            }
                        },
                        {
                            field: 'checkTime',
                            title: '审核时间',
                            width: 190,
                            align: 'center',
                            templet: function(d) {
                                return dateUtil.formatDate(new Date(d.createTime), "yyyy-MM-dd hh:mm:ss");
                            }
                        },
                        {
                            field: 'checkRemark',
                            title: '审核备注',
                            align: 'center'
                        },
                        {
                            title: '操作',
                            width: 220,
                            templet: '#entityBar',
                            align: "center",
                            fixed: 'right'
                        }];
                }else{
                    cols = [{
                        type: 'checkbox',
                        fixed: 'left'
                    },
                        {
                            type: 'numbers',
                            title: '序号'
                        },
                        {
                            field: 'name',
                            title: '姓名',
                            align: 'center'
                        },
                        {
                            field: 'userType',
                            title: '用户类型',
                            align: 'center',
                            templet: function(d) {
                                return pageUtil.aceeptDictContentName(dictData, 'web_user_type', d.userType);
                            }
                        },
                        {
                            field: 'headImage',
                            title: '照片',
                            align: 'center',
                            templet: function(d) {
                                return "<img lay-event ='showPicture' src='"+d.headImage+"' style='width:auto; height: 80px;'/>";
                            }
                        },
                        {
                            field: 'brithday',
                            title: '出生日期',
                            align: 'center'
                        },
                        {
                            field: 'idCard',
                            title: '身份证号',
                            align: 'center'
                        },
                        {
                            field: 'idCardPicture',
                            title: '身份证照片',
                            align: 'center',
                            templet: function(d) {
                                return "<img lay-event ='showPicture' src='"+d.idCardPicture+"' style='width:auto; height: 80px;'/>";
                            }
                        },
                        {
                            field: 'sex',
                            title: '性别',
                            align: 'center',
                            templet: function(d) {
                                return pageUtil.aceeptDictContentName(dictData, 'base_sex', d.sex);
                            }
                        },
                        {
                            field: 'nation',
                            title: '民族',
                            align: 'center'
                        },
                        {
                            field: 'political',
                            title: '政治面貌',
                            align: 'center'
                        },
                        {
                            field: 'phone',
                            title: '联系电话',
                            align: 'center'
                        },
                        {
                            field: 'workAddress',
                            title: '工作单位',
                            align: 'center'
                        },
                        {
                            field: 'homeAddress',
                            title: '家庭地址',
                            align: 'center'
                        },
                        {
                            field: 'createTime',
                            title: '报名时间',
                            width: 190,
                            align: 'center',
                            templet: function(d) {
                                return dateUtil.formatDate(new Date(d.createTime), "yyyy-MM-dd hh:mm:ss");
                            }
                        },
                        {
                            field: 'status',
                            title: '审核状态',
                            align: 'center',
                            templet: function(d) {
                                return pageUtil.aceeptDictContentName(dictData, 'base_check_status', d.status);
                            }
                        },
                        {
                            field: 'checkTime',
                            title: '审核时间',
                            width: 190,
                            align: 'center',
                            templet: function(d) {
                                return dateUtil.formatDate(new Date(d.createTime), "yyyy-MM-dd hh:mm:ss");
                            }
                        },
                        {
                            field: 'checkRemark',
                            title: '审核备注',
                            align: 'center'
                        },
                        {
                            title: '操作',
                            width: 220,
                            templet: '#entityBar',
                            align: "center",
                            fixed: 'right'
                        }];
                }

                tableIns = pageUtil.initDate(cols, url, true);
            });
        table.on('tool(entityList)',
            function(obj) {
                var layEvent = obj.event,
                    data = obj.data;
                if (layEvent === 'edit') {
                    pageUtil.editPopup("编辑", "/webOrder/getEntity?id=" + data.id);
                } else if (layEvent === 'showPicture') {
                    fileUtil.imageSingleShow(data.picture);
                }  else if (layEvent === 'print') {
                    parent.tabAddUrl("/webOrder/getPrint?id=" + data.id,data.name+"报名打印")
                }  else if (layEvent === 'del') {
                    pageUtil.delete("确定删除该项吗？", "/webOrder/delete", {
                            "id": data.id,
                            "_method": "DELETE"
                        },
                        function(data) {
                            tableIns.reload();
                        });
                }
            });
    })</script>
</body>

</html>